package com.szjlc.responsebodyadvice.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;


/**
 * 雇员表(employee)实体类
 * @author makejava
 * @since 2022-11-19 14:35:46
 */

@ApiModel(value = "雇员表(employee)实体类", description = "雇员")
@SuppressWarnings("all")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Employee implements Serializable {

    private static final long serialVersionUID = -33674036610094057L;

    /** 雇员id */
    // 更新时，empId不能为空
    @ApiModelProperty(value = "雇员id")
    @NotNull(groups = {Employee.Update.class})
    @Min(value = 1, groups = {Update.class})
    private Long empId;

    /** 员工姓名 */
    @ApiModelProperty(value = "员工姓名")
    @NotBlank
    @Length(min = 2, max = 10)
    private String name;

    /** 性别；0-女 1-男 */
    @ApiModelProperty(value = "性别；0-女 1-男")
    @Range(min = 0, max = 1)
    private Byte gender;

    /** 标题 */
    @ApiModelProperty(value = "标题")
    private String title;

    /** 生日 */
    @ApiModelProperty(value = "生日")
    private Date birthday;

    /** 部门id */
    @ApiModelProperty(value = "部门id")
    private String depId;

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }

    /** 保存的时候校验分组 */
    public interface Save {

    }

    /** 更新的时候校验分组 */
    public interface Update {
    }
}
